package com.example.benefitcommunity.controller;

import com.example.benefitcommunity.entity.BcReply;
import com.example.benefitcommunity.entity.BcReply;
import com.example.benefitcommunity.entity.Result;
import com.example.benefitcommunity.service.BcReplyService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 回复表(BcReply)表控制层
 *
 * @author makejava
 * @since 2025-08-30 17:41:14
 */
@Tag(name = "回复")
@CrossOrigin
@RestController
@RequestMapping("bcReply")
public class BcReplyController {
    /**
     * 服务对象
     */
    @Resource
    private BcReplyService bcReplyService;

    /**
     * 通过查询数据
     *
     * @param commentid   动态id
     * @return 数据
     */
    @Operation(description = "回复查询")
    @GetMapping("list")
    public Result<Object> queryByReply(Integer commentid) {
        return this.bcReplyService.queryByReply(commentid);
    }

    /**
     * 新增数据
     *
     * @param bcReply 实体
     * @return 新增结果
     */
    @Operation(description = "新增回复")
    @PostMapping("add")
    public Result<Object> add(@RequestBody BcReply bcReply) {
        return this.bcReplyService.insert(bcReply);
    }

}

